home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
science
/
cdrift3.zip
/
HOWTORUN.DOC
< prev
next >
Wrap
Text File
|
1990-02-22
|
9KB
|
189 lines
COMPILING AND RUNNING TEC ON THE AMIGA
Compile tec1.c, tec2.c, tec3.c and ami.c. I have Lattice C 4.0
and I use lc1 -oram:, lc2 -ccdb -v. The -ccdb puts the entire
executable into chip ram; this is overkill, but the custom chips have
to be able to get to the graphics structures in ami.c. Then BLink the
four .o files along with the startup code and the lcm, lc and amiga
libraries (lcm has to be before lc, but you knew that).
Tec doesn't need any command line arguments, but if you wish to store
snapshots you should redirect standard output to a file, for example
tec >ram:tec.out
Each snapshot is about 32K of text.
When the program comes up, it opens a 5 bitplane 320 x 200 screen with one
big window. If you need to see the Workbench screen again you can use
left-amiga-m,n. After a second or two, a big green blob will pop up. This
is the initial supercontinent. Every three seconds or so, another "step" will
be computed and drawn.
Altitudes are represented by colors; from lowest to highest, these are:
black (ocean), dark blue (deep continental shelf), bright blue (higher
continental shelf), dark green (lowest abovewater elevation), bright green,
dark red, bright red, purple, white, yellow. There are about 24 visibly
different altitude ranges, since each color has several shades.
As time passes, you will see the supercontinent split up; red and purple
mountains will appear on the leading edges of drifting continents; when
continents slow down, reverse course, and collide, high purple and white
mountains will appear. If you watch carefully, you can see erosion on
mountains that are not growing; they turn dark red and then bright green.
At any time, you can click on the close window gadget to kill the program.
It only checks the mouse once per update, so it may take the program a few
seconds to notice you have killed it.
If you click the left mouse button anywhere but on the close gadget, the
program will pause after the next update and write 450 lines of data to
stdout. If you have not redirected stdout to a file, it takes about two
minutes for it all to come out; redirected to ram:, it takes about 30
seconds. The program obviously will not do anything else during this time.
Typing ctrl-C will bring up a Lattice requester asking if you want to abort;
I don't advise this, because the abort does not close the window and screen.
COMPILING AND RUNNING TEC ON A UN*X PLATFORM
Type "cc -o tec tec?.c unix.c -lm" to create an executable called tec.
Tec doesn't need any command line arguments and prints all its output
to stdout. To do almost anything interesting, you will have to adjust
the parameters, as explained in the file params.doc.
COMPILING AND RUNNING TEC UNDER SUNVIEW
Type "cc -o tec tec?.c sun.c -lsuntool -lsunwindow -lpixrect -lm" to make
an executable called tec. A canvas subwindow is opened; every second or so
another step will be displayed. On the Sparcstation several steps are
displayed per second. The colors displayed are identical to those
used in the Amiga version. Use the Sunview menu to exit the program. I
am using the simplest Sunview interface scheme, and you have to hold the
mouse button down for a couple of seconds to get the menu. Currently it is
not possible to tell the Sunview version of tec to print output; use the
Un*x version for that.
COMPILING AND RUNNING TEC ON AN IBM PC/XT/AT OR 100% COMPATIBLE (TURBO C 2.00+)
(This section by Peter Lind)
Suggested Compiler Configuration
The following compiler options are recommended to yield the fastest execution
speed. Any or all may be changed as the user sees fit. On 80x86 machines (as
opposed to the 8088), enabling word-boundary alignment will increase speed.
On 80186/80286 machines, enabling the extended instruction set will also yield
a speed-up. If an 80x87 is available, enable generation of 80x87 code. Finally,
for best results, disable all debugging-oriented options.
Memory Model : Compact (or Large or Huge).
Optimization : Optimize for speed
Use of registers ON
Register optimization ON
Jump optimization ON
Option 1 -- Integrated Environment
Create a file called TEC.PRJ containing the lines 'tec1.c', 'tec2.c',
'tec3.c', 'ibmpc.c'. Set the Project name to TEC.PRJ and press F9 to make.
The resulting file will be called TEC.EXE. Ignore the warnings produced.
Option 2 -- Command Line Make
Read through the comments in the make file TEC.MAK; the macro directory
names may have to be changed to conform with your system; also, there are
certain macros that can be changed to compile TEC for an 80186/80286
and/or an 80x87.
Run the Turbo C MAKE utility with the command line: make -ftec.mak
The included makefile TEC.MAK uses the command line options listed below;
either of these may be changed to suit the user's preference:
-mc Compact memory model
-G Optimize for speed
-w- Suppress warnings
-a Align to word
A Note on Required Files (supplied with Turbo)
i) Either (or both) .BGI files (CGA.BGI and EGAVGA.BGI) must reside in the
*current* DOS directory (where it is assumed TEC.EXE resides).
ii) If TEC is to be run in EGA/VGA mode, TRIP.CHR should reside in the
*current* DOS directory.
If TEC is to be run in CGA/MCGA mode, LITT.CHR should reside in the
*current* DOS directory.
iii) If the programmer wants to execute TEC via the DOS search path, then
modifications will have to be made to IBMPC.C, and (sorry, but) the
programmer is on his/her own since this problem is not straightforward
and could be solved in a variety of ways (most simple of which would be
to place the *exact* DOS path in double quotes as the third parameter
to grafinit() in IBMPC.C).
Running the Program
The IBM PC version of TEC will run under CGA, MCGA, EGA or VGA graphics,
auto-detecting the graphics hardware and choosing the mode with highest
resolution. Since CGA and MCGA hi-res modes provide only two colors (black
and white), a rudimentary 3-D plotting facility is provided to take the
place of the standard multi-colored plotting. In EGA or VGA, the user may
switch between the multi-colored and 3-D modes as desired. The 3-D facility
is rather sluggish, but produces interesting plots; it can be run in either
"fast" or "slow". In slow mode, each "pixel" of the plate tectonics is drawn
as a 3-D block. In fast mode, all "pixels" in the same row with the same height
are merged and plotted as a wide "slab". The fast mode is faster, but the plot
produced does not look as good as that generated by the slow mode.
When TEC.EXE is run, the introductory credits panel will first be displayed;
press any key to cause the program to continue. A window will then be drawn on
the screen with a title bar along the top and a message line along the bottom.
The program will display the message "Setting up..." while the initial data
structure preparation is performed. Then, TEC will enter its main loop that
repeatedly generates one "time step" and displays the map.
a) Thinking Phase: TEC displays the message "Thinking..." while generating the
next step. While TEC is "thinking", the user may press a key:
ESC Abort to DOS when finished thinking
SPACE Pause after plotting until any key pressed
p or P Print (Generic, Text or Postscript)
g or G Change plotting style (Standard, Slow 3-D, Fast 3-D)
TEC will respond to the key press when it finishes thinking.
b) Plotting Phase: When finished thinking, and provided that the user did not
abort the program, TEC will display the message "Plotting..." and begin
plotting the current step. In CGA/MCGA, the plotting is always monochromatic
simulated 3-D. In EGA/VGA, TEC displays different altitudes in different
colors. From lowest to highest, these are: black (ocean), dark blue (deep
continental shelf), light blue (higher continental shelf), dark green
(lowest abovewater elevation), light green, yellow, magenta, light magenta,
dark red, light red, brown, light gray, and white. There are 13 visibly
different altitude ranges.
The following keys are recognized while plotting:
ESC Abort to DOS immediately
CR Skip current plot (immediately start next thinking phase)
p or P Print (Generic, Text or Postscript) when done plotting
g or G Change plotting style (Standard, Slow 3D, Fast 3D)
If `p' (or `P') is pressed, the print operation will start after the plot is
completed. Note that printing will not proceed unless stdout was redirected
on the command line, as in:
TEC >TEC.OUT
The action that TEC takes when `g' (or `G') is pressed depends on the
graphics mode:
(i) If TEC is running under CGA or MCGA, the user is able to switch
immediately between fast or slow 3-D plotting (but is unable to
switch to standard, color plotting).
(ii) If TEC is running under EGA or VGA, the command is deferred
until the plot is finished (as the plot cannot be restarted).